<?php if (!defined('SERVER_ROOT')) exit('No direct script access allowed');

class lopgiangday_Controller extends Controller {

    function __construct()
    {
        parent::__construct('giaovukhoa', 'lopgiangday');
        $this->check_login();
        $this->view->template->menu_html =$this->CREATE_MENU();
        $this->view->template->nhacviec_html =$this->CREATE_NHAC_VIEC(); 
        $this->CHECK_QUYEN('giaovukhoa', 'lopgiangday');
    }

    function main(){
        $this->dsp_all_lopgiangday();
    }

    function dsp_all_lopgiangday(){
        $VIEW_DATA['arr_all_lopgiangday']= $this->model->qry_all_lopgiangday();
        $this->view->render('dsp_all_lopgiangday', $VIEW_DATA);
    }
    public function dsp_single_lopgiangday($MA_LOP_GIANG_DAY){
        $MA_LOP_GIANG_DAY = replace_bad_char($MA_LOP_GIANG_DAY);
        $VIEW_DATA['arr_all_loailopday'] = $this->model->SELECT_LOAILOPDAY_nothing();
        $VIEW_DATA['arr_single_lopgiangday'] = $this->model->qry_single_lopgiangday($MA_LOP_GIANG_DAY);
        $this->view->render('dsp_single_lopgiangday', $VIEW_DATA);
    }
    public function update_lopgiangday()
    {
        $this->model->goback_url = $this->view->get_controller_url() . 'dsp_all_lopgiangday';
        $this->model->update_lopgiangday();
    }
    public function delete_lopgiangday(){
        $this->model->goback_url = $this->view->get_controller_url() . 'dsp_all_lopgiangday';
        $this->model->delete_lopgiangday();
    }
}